@model LoginViewModel

<div class="login-page">
    <div class="lead">
        <h1>登录</h1>
        <p>选择登录方式</p>
    </div>

    <partial name="_ValidationSummary" />

    <div class="row">

        @if (Model.EnableLocalLogin)
        {
            <div class="col-sm-6">
                <div class="card">
                    <div class="card-header">
                        <h2>账号密码登录</h2>
                    </div>

                    <div class="card-body">
                        <form asp-route="Login">
                            <input type="hidden" asp-for="ReturnUrl" />

                            <div class="form-group">
                                <input class="form-control" placeholder="用户名/邮箱/手机号" asp-for="Username" autofocus>
                            </div>
                            <div class="form-group">
                                <input type="password" class="form-control" placeholder="密码" asp-for="Password" autocomplete="off">
                            </div>
                            @if (Model.AllowRememberLogin)
                            {
                                <div class="form-group">
                                    <div class="form-check">
                                        <input class="form-check-input" asp-for="RememberLogin">
                                        <label class="form-check-label" asp-for="RememberLogin">
                                            记住我
                                        </label>
                                    </div>
                                </div>
                            }

                            <div>
	                            <p><span>不是自己的电脑上不要勾选此项</span><span><a href="#" target="_blank">忘记密码?</a></span></p>
                            </div>

                            <button class="btn btn-primary" name="button" value="login">登录</button>
                            @*<button class="btn btn-secondary" name="button" value="cancel">Cancel</button>*@
                            <button class="btn btn-secondary" name="button" value="register">注册</button>
                        </form>
                    </div>
                </div>
            </div>
        }

        @if (Model.VisibleExternalProviders.Any())
        {
            <div class="col-sm-6">
                <div class="card">
                    <div class="card-header">
                        <h2>其它登录方式</h2>
                    </div>
                    <div class="card-body">
                        <ul class="list-inline">
                            @foreach (var provider in Model.VisibleExternalProviders)
                            {
                                <li class="list-inline-item">
                                    <a class="btn btn-secondary"
                                       asp-controller="External"
                                       asp-action="Challenge"
                                       asp-route-scheme="@provider.AuthenticationScheme"
                                       asp-route-returnUrl="@Model.ReturnUrl">
                                        @provider.DisplayName
                                    </a>
                                </li>
                            }
                        </ul>
                    </div>
                </div>
            </div>
        }

        @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any())
        {
            <div class="alert alert-warning">
                <strong>无效的登录请求</strong>
	            没有为此请求配置登录方案。
            </div>
        }
    </div>
</div>